package com.seal.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.seal.comm.utils.Page;
import com.seal.dao.IDatadictDao;
import com.seal.model.Datadict;
import com.seal.service.IDatadictService;

@Service("datadictServiceImpl")
@Transactional(readOnly = true)
public class DatadictServiceImpl implements IDatadictService {

	@Resource(name = "datadictDaoImpl")
	private IDatadictDao datadictDao;

	public String getDataRemark(String datakey, String datavalue)
			throws Exception {
		return datadictDao.getDataRemark(datakey, datavalue);
	}

	public String getDataValue(String datakey) throws Exception {
		return datadictDao.getDataValue(datakey);
	}

	public List<Datadict> getDatadict(String datakey)
			throws Exception {
		return datadictDao.getDatadict(datakey);
	}

	public List<Datadict> getAllDatadict(Page pageObj) throws Exception {
		return datadictDao.getAllDatadict(pageObj);
	}
	@Transactional(propagation = Propagation.REQUIRED,readOnly = false,rollbackForClassName="Exception")
	public boolean addKeyValue(Datadict data) {
		return datadictDao.addKeyValue(data);
	}
	@Transactional(propagation = Propagation.REQUIRED,readOnly = false,rollbackForClassName="Exception")
	public boolean delDatadict(Long id) {
		datadictDao.delDatadict(id);
		return true;
	}
	@Transactional(propagation = Propagation.REQUIRED,readOnly = false,rollbackForClassName="Exception")
	public boolean updateKeyValue(Datadict data) {
		return datadictDao.updateKeyValue(data);
	}
}
